package com.alan.camunda.boot.listener;

import lombok.extern.slf4j.Slf4j;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.ExecutionListener;
import org.camunda.bpm.model.bpmn.instance.FlowElement;
import org.springframework.stereotype.Component;

@Slf4j
@Component("beforeWaitListener")
public class BeforeWaitListener implements ExecutionListener {

    @Override
    public void notify(DelegateExecution execution) throws Exception {
        String currentActivityId = execution.getCurrentActivityId();
        FlowElement fe = execution.getBpmnModelElementInstance();

        log.info("BeforeWaitListener, currentActivityId: {}, elementName: {}", currentActivityId, fe.getName());
    }


}
